package topevery.syn.data.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import topevery.syn.data.model.codec.ModelTypeEnumCodec;

import java.time.LocalDateTime;

@Data
public class WeightData implements IGlbModel {

    @JSONField(name = "a")
    public Long gid;

    @JSONField(name = "b" ,serializeUsing = ModelTypeEnumCodec.class, deserializeUsing = ModelTypeEnumCodec.class)
    public ModelTypeEnum modelType = ModelTypeEnum.Weight;

    @Override
    public Long getGid() {
        return gid;
    }

    @Override
    public void setGid(Long gid) {
        this.gid = gid;
    }

    @Override
    public ModelTypeEnum getModelType() {
        return modelType;
    }

    @Override
    public void setModelType(ModelTypeEnum modelType) {
        this.modelType = modelType;
    }

    @JSONField(name = "d")
    public Long fid;
    @JSONField(name = "e")
    public String clientIp;
    @JSONField(name = "f")
    public Integer clientPort;
    @JSONField(name = "g")
    public String dtuCode;
    @JSONField(name = "h")
    public Integer seqId;
    /// <summary>
    /// 称重设备编
    /// </summary>
    @JSONField(name = "i")
    public Integer refuseBoxId;

    /// <summary>
    /// 称重记录重量
    /// </summary>
    @JSONField(name = "m")
    public Integer weightNumber;
    /// <summary>
    /// 称重记录时间：WeightDate+=(DtuDate-BoxDate)
    /// </summary>
    @JSONField(name = "n")
    public LocalDateTime weightDate;
    @JSONField(name = "o")
    public Double lngSrc;
    @JSONField(name = "p")
    public Double latSrc;
    @JSONField(name = "q")
    public Double latMctY;
    @JSONField(name = "r")
    public Double lngMctX;
    @JSONField(name = "s")
    public Double lng;
    @JSONField(name = "t")
    public Double lat;

    @JSONField(name = "u")
    public LocalDateTime dbCreateDate;

    /// <summary>
    /// 垃圾桶状态：0--非最高位   1--最高位
    /// </summary>
    @JSONField(name = "v")
    public Short ashcanStatus;

    /// <summary>
    /// 位置时间
    /// </summary>
    @JSONField(name = "w")
    public LocalDateTime posDate;

    /// <summary>
    /// 方位
    /// </summary>
    @JSONField(name = "x")
    public Integer direction;

    /// <summary>
    /// 速度
    /// </summary>
    @JSONField(name = "y")
    public Double speed;

    /// <summary>
    /// 收星数
    /// </summary>
    @JSONField(name = "z")
    public Short starNumber;
    /// <summary>
    /// 北斗收星数
    /// </summary>
    @JSONField(name = "a1")
    public Short starNumberBd;
    /// <summary>
    /// GNSS指标
    /// </summary>
    @JSONField(name = "a2")
    public Double gnssValue;
    /// <summary>
    /// 加速度x轴
    /// </summary>
    @JSONField(name = "a3")
    public Double upspeedX;
    /// <summary>
    /// 加速度y轴
    /// </summary>
    @JSONField(name = "a4")
    public Double upspeedY;
    /// <summary>
    /// 加速度z轴
    /// </summary>
    @JSONField(name = "a5")
    public Double upspeedZ;
    /// <summary>
    /// 电子罗盘x轴
    /// </summary>
    @JSONField(name = "a6")
    public Double compassX;
    /// <summary>
    /// 电子罗盘y轴
    /// </summary>
    @JSONField(name = "a7")
    public Double compassY;
    /// <summary>
    /// 电子罗盘z轴
    /// </summary>
    @JSONField(name = "a8")
    public Double compassZ;

    /// <summary>
    /// 称重记录类型 0--定时上报   1--最高点上报
    /// 压缩箱摇臂状态 0：压缩箱摇臂未工作 1：压缩箱摇臂工作中
    /// </summary>
    @JSONField(name = "a9")
    public Short weightType;

    /// <summary>
    /// 中转站dut编码
    /// </summary>

    @JSONField(name = "b1")
    public String stationDtuCode;

    /// <summary>
    /// 0 实时上传
    /// 1 补传
    /// </summary>
    @JSONField(name = "b2")
    public Short upType;

    public Integer dataType;

    @JSONField(name = "j")
    public  LocalDateTime dtuTimingDate;
    @JSONField(name = "k")
    public  LocalDateTime boxTimingDate;
    @JSONField(name = "l")
    public  LocalDateTime weightDateOld;

    @Override
    public String getGlbModelKey() {
        return dtuCode;
    }
}
